<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a th:href="@{/toadd}">添加</a>
<form action="/findByName" method="get">
    <input type="text" name="name">
    <input type="submit" value="搜索">
</form>
    <table>
        <tr>
            <td>编号</td>
            <td>姓名</td>
            <td>性别</td>
            <td>密码</td>
            <td>年龄</td>
            <td>数字</td>
            <td>操作</td>
        </tr>
        <tr th:each="user:${page.records}">
            <td th:text="${user.id}"></td>
            <td th:text="${user.name}"></td>
            <td th:text="${user.gender}"></td>
            <td th:text="${user.password}"></td>
            <td th:text="${user.age}"></td>
            <td th:text="${user.tel}"></td>
            <td>
                <a th:href="@{/del(id=${user.id})}">删除</a>
                <a th:href="@{/findById(id=${user.id})}">修改</a>
            </td>
        </tr>
        <tr>
            <td colspan="5">
                <a th:href="@{/findAll(current=1)}">首页</a>
                <a th:if="${page.current > 1}" th:href="@{/findAll(current=${page.current - 1})}">上一页</a>
                <a th:if="${page.current < page.pages}" th:href="@{/findAll(current=${page.current + 1})}">下一页</a>
                <a th:href="@{/findAll(current=${page.pages})}">尾页</a>
                第<span th:text="${page.current}"></span>页/共<span th:text="${page.pages}"></span>页
            </td>
        </tr>
    </table>

</body>
</html>